package cn.wolfcode.wolf2w.common.redis.util;

import lombok.Getter;

/**
 * @author : 邓风来
 * @date : 2025/9/16 11:03
 */
@Getter
public enum RedisKeys {
    USER_NOTE_THUMBSUP( "user_note_thumbsup",-1l ),
    NOTE_STATIS_HASH("note_statis_hash",-1),
    USER_STRATEGY_THUMBSUP("user_strategy_thumbsup",-1l),
    USER_NOTE_FAVOR("user_note_favor",-1l),
    USER_STRATEGY_FAVOR("user_strategy_favor",-1l),
    STRATEGY_STATIS_HASH("strategy_statis_hash",-1),
    VERIFY_CODE("verify_code",5*60);
    // key的前缀
    private String prefix;
    // key的过期时间
    private long time;

    private RedisKeys(String prefix,long time){
        this.time = time;
        this.prefix = prefix;
    }
    public String join(String... value){
        StringBuffer sb = new StringBuffer();
        sb.append(this.prefix);
        for (String s : value) {
            sb.append(":").append(s);
        }
        return sb.toString();
    }
}
